package com.zj.z11select.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 用户信息表 
 * </p>
 * @author ZHOUJIE
 * @since 2021-07-06
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("user")
@ApiModel(value="Users对象", description="用户信息表 ")
public class User implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "真实姓名")
    private String realName;

    /**
     * 注册时自动填充为默认头像
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "头像")
    private String userPic;

    @ApiModelProperty(value = "手机号")
    private String userMobile;

    @ApiModelProperty(value = "邮箱地址")
    private String userEmail;

    /**
     * 注册时自动填充为未知
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "性别(1-男，2-女，3-未知)")
    private Integer userSex;

    @ApiModelProperty(value = "生日")
    private Date userBirth;

    /**
     * 注册时自动填充现在时间
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "注册时间")
    private Date createTime;

    /**
     * 注册和修改时自动填充现在时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    public User(String username,String password){
        this.username = username;
        this.password = password;
    }


}
